namespace Sustainalytics.Entities
{
    using System;

    public class AutomaticSystemPortfolio : SystemPortfolio
    {
        public AutomaticSystemPortfolio(Guid id, string name, Guid[] accountIds)
            : this(id, name, accountIds, DateTime.Today, DateTime.Today)
        {   
        }

        internal AutomaticSystemPortfolio(string name, Guid[] accountIds)
            : this(Guid.NewGuid(), name, accountIds, DateTime.Today, DateTime.Today)
        {
        }

        private AutomaticSystemPortfolio(Guid id, string name, Guid[] accountIds,  DateTime dateCreated, DateTime dateModified)
            : base(id, name, accountIds)
        {
            this.AddedByFullName = "system";
            this.AddedByUserId = Guid.Empty;
            this.AddedByUserName = "system";
            this.IsReadonly = true;
            this.SharingStatus = PortfolioSharingStatus.Shared;
            this.RelatedUniverses = new[] { new RelatedUniverse(id, name) };
            this.DataCreated = dateCreated;
            this.DateModified = dateModified;
        }
    }
}